<?php
namespace common\models\credit_old_app_tables;

use Yii;

/**
 * This is the model class for table "{{%dict}}".
 *
 * @property int $d_id ID
 * @property int $d_fid 父级ID
 * @property string $d_text 名称
 * @property string $d_type 类型
 * @property string $d_ftext 父级名称
 * @property string $d_ftype 父级类型
 * @property int $d_org_id 单位ID
 * @property string $d_status
 * @property string $d_pym
 * @property int $d_order 排序
 * @property int $d_score 分值
 * @property string $d_zname 简称
 * @property string $d_info 备注
 * @property string $d_num 编号
 */
class SlDict extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%dict}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_old_app');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['d_fid', 'd_org_id', 'd_order', 'd_score'], 'integer'],
            [['d_ftext', 'd_ftype', 'd_zname', 'd_info'], 'required'],
            [['d_status'], 'string'],
            [['d_text', 'd_ftext', 'd_pym', 'd_zname'], 'string', 'max' => 100],
            [['d_type', 'd_ftype'], 'string', 'max' => 20],
            [['d_info'], 'string', 'max' => 200],
            [['d_num'], 'string', 'max' => 50],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'd_id' => Yii::t('app', 'ID'),
            'd_fid' => Yii::t('app', '父级ID'),
            'd_text' => Yii::t('app', '名称'),
            'd_type' => Yii::t('app', '类型'),
            'd_ftext' => Yii::t('app', '父级名称'),
            'd_ftype' => Yii::t('app', '父级类型'),
            'd_org_id' => Yii::t('app', '单位ID'),
            'd_status' => Yii::t('app', 'D Status'),
            'd_pym' => Yii::t('app', 'D Pym'),
            'd_order' => Yii::t('app', '排序'),
            'd_score' => Yii::t('app', '分值'),
            'd_zname' => Yii::t('app', '简称'),
            'd_info' => Yii::t('app', '备注'),
            'd_num' => Yii::t('app', '编号'),
        ];
    }
}